//
//  //  柳州微博
//
//  Created by Apple_Lzzy40 on 16/9/21.
//  Copyright © 2016年 Apple_Lzzy40. All rights reserved.
//

#import "ZQSearchBar.h"

@implementation ZQSearchBar

+(instancetype)searchBar
{
    return [[self alloc]init];
}
-(instancetype)initWithFrame:(CGRect)frame
{
    self=[super initWithFrame:frame];
    if (self) {
        self.placeholder=@"           请输入搜索条件";
        self.font=[UIFont systemFontOfSize:13];
        self.background=[UIImage imageNamed:@"searchbar_textfield_background"];
     //   self.navigationItem.titleView=searchBar;
        
        //把放大镜添加到searchBar
        UIImageView * searchIcon=  [[UIImageView alloc]init];
        searchIcon.image=[UIImage imageNamed:@"searchbar_textfield_search_icon"];
        searchIcon.width=30;
        searchIcon.height=30;
        searchIcon.contentMode=UIViewContentModeCenter;
        self.leftView=searchIcon;
        self.leftViewMode=UITextFieldViewModeAlways;
    }
    return self;
}
@end
